package   com.NeuglsWorkStudio.UI.Buttons
{
	
	import flash.display.DisplayObject;
	import flash.events.EventDispatcher;
	import flash.events.MouseEvent;

	public class TRadioButton extends TIconButton
	{
		[Embed(source="images/Button/RadioCheck.png")]
		private var _FCheckedIcon:Class;
		
		[Embed(source="images/Button/RadioNoCheck.png")]
		private var _FNoCheckedIcon:Class;
		
		private var _FGroupName:String="Group1";
		private var _FID:Number=Number(-1);
		
		
		public function TRadioButton(ACaption:String="",IsHtml:Boolean=true,BaceColor:int=0x222222)
		{
			super(ACaption,IsHtml,BaceColor);
			this.IconSize=20;
			this.IconTextMargin=2;
			this.CheckedIcon= new _FCheckedIcon() as DisplayObject;
			this.NoCheckedIcon = new _FNoCheckedIcon() as DisplayObject;
			
		}
		
		public function get ID():Number
		{
			return _FID;
		}

		public function set ID(value:Number):void
		{
			_FID = value;
		}

		public function get GroupName():String
		{
			return _FGroupName;
		}

		public function set GroupName(value:String):void
		{
			_FGroupName = value;
		}

		override protected function FClick(Event:MouseEvent):void{
			super.FClick(Event);
			//this.Checked=!this.Checked;
			var _FRaidoEvent:TRaidoEvent = new TRaidoEvent(TRaidoEvent.RADIOCLICK);
			_FRaidoEvent.GroupName=_FGroupName;
			_FRaidoEvent.ID=_FID;
			dispatchEvent(_FRaidoEvent);
		}
	}
}